<template>
  <div id="app" style="margin: 0; padding: 0;">
    <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
      style="margin: 0; padding: 0;">
      <el-menu-item index="1">生成模型</el-menu-item>
      <el-menu-item index="2">生成参数对象</el-menu-item>
      <el-menu-item index="3">生成CRUD</el-menu-item>
      <el-menu-item index="4">生成API</el-menu-item>
      <el-menu-item index="5">Minio上传文件示例</el-menu-item>
    </el-menu>
    <router-view></router-view>
  </div>
</template>

<script>
import router from './router/index'

export default {
  data () {
    return {
      activeIndex: '1'
    }
  },
  mounted () {
    router.push('/generateModel')
  },
  methods: {
    handleSelect (key) {
      switch (key) {
        case '1':
          router.push('/generateModel')
          break
        case '2':
          router.push('/generateSchema')
          break
        case '3':
          router.push('/generateCRUD')
          break
        case '4':
          router.push('/generateAPI')
          break
        case '5':
          router.push('/MinIOUpload')
          break
        default:
          router.push('/')
          break
      }
    }
  }
}
</script>

<style>

</style>
